<?php
	header("Content-Type: text/html; charset=utf-8");
	header('Access-Control-Allow-Origin:*');
	header('Access-Control-Allow-Methods:POST');
	header('Access-Control-Allow-Headers:x-requested-with,content-type');
	require_once('DBDA.php');
	$db=new DBDA();

	session_start();
	session_write_close();

	$table = "onlinebackup";
	$dba='test';

	/*保存网页备份内容*/


	$act 		= $_POST['act'];

	switch ($act) {
	    // 城市燃气-获取微信公众号绑定的用户列表
	    case 'CSRQ_getUserList':
            $json_string = file_get_contents('./json/绑定的用户列表数据.json');
            $j= json_decode($json_string);
            echo $json_string;
	    break;
	    // 城市燃气-获取微信公众号=== 缴费记录列表
	    case 'CSRQ_getRecodeList':
            $json_string = file_get_contents('./json/缴费记录列表数据.json');
            $j= json_decode($json_string);
            echo $json_string;
	    break;
	    // 获取通知公告列表
        case "CSRQ_getnotificationAnnouncement":
            $json_string = file_get_contents('./json/通知公告数据.json');
            $j= json_decode($json_string);
            echo $json_string;
            break;
            //
        // 获取通知公告详情
        case "CSRQ_getnotificationDetail":
            $json_string = file_get_contents('./json/通知公告数据详情.json');
            $j= json_decode($json_string);
            echo $json_string;
            break;
        // 安检记录列表
        case "CSRQ_getSecurityRecord":
            $json_string = file_get_contents('./json/安检记录列表数据.json');
            $j= json_decode($json_string);
            echo $json_string;
            break;
        // 安检记录详情
        case "CSRQ_getSecurityRecordDetail":
            $json_string = file_get_contents('./json/安检记录详情数据.json');
            $j= json_decode($json_string);
            echo $json_string;
            break;
            // 获取预约记录列表
        case "CSRQ_getDataListAppointent";
            $json_string = file_get_contents('./json/预约记录列表数据.json');
            $j= json_decode($json_string);
            echo $json_string;
        break;
        // 获取预约记录详情
        case "CSRQ_getAppointmentDetail":
            $json_string = file_get_contents('./json/预约记录详情数据.json');
            $j= json_decode($json_string);
            echo $json_string;
            break;
         // 营业网点数据
        case "CSRQ_getdataSaleNetwork":
            $json_string = file_get_contents('./json/营业网点列表数据.json');
            $j= json_decode($json_string);
            echo $json_string;
            break;
        default:

            break;

	}

function strToUtf8($str){
    $encode = mb_detect_encoding($str, array("ASCII",'UTF-8',"GB2312","GBK",'BIG5'));
    if($encode == 'UTF-8'){
        return $str;
    }else{
        return mb_convert_encoding($str, 'UTF-8', $encode);
    }
}
